<?php
class User extends AppModel {

	public $name = 'User';
	public $validate = array(
		'email' => array('email'),
		'password' => array('alphanumeric')
	);

	public function authenticate($username, $password)
	{
		$user = $this->find('first', array('conditions' => array('User.password' => $password, 
			'User.email' => $username)));

		return $user;
	}

}